<%@ include file="base.jsp" %>
<%@ page language="java"%>
<%@ page import="net.amsoft.iservice.icontact.util.IContactConstants" %>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles"%>
	
<%
		response.setHeader("Expires", "never expires");
        response.setHeader("Cache-Control", "public");
        response.setHeader("Pragma", "cache");
 %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<script type="text/javascript" language="javascript" src="js/email.js"></script>
<script type="text/javascript" language="JavaScript">
<!--
    function submitForm(step)
    {
    	document.RequestForm.step.value=step;
	if(trim(document.RequestForm.msg.value) == "" && document.RequestForm.step.value != "cancel"){
               	if(!window.confirm("Do You want to send empty message"))
       	             return;
        }

    		document.RequestForm.submit();
    }

    function chkEmailAddr(objName)
    {
        if(emailCheck(objName.value)==false)
        {
            objName.select();
            objName.focus();
            return false;
        }else
        {
            return true;
        }
    }
	function checkLength(name,size)
	{
		var textBox = document.getElementsByName(name)[0].value;
		if (textBox.length>size)
		{
			document.getElementsByName(name)[0].value = textBox.substring(0,size);
		}
	}
//-->
</SCRIPT>
<meta content="text/html; charset=UTF-8" http-equiv="content-type">
<logic:present name="ContactPage" scope="session">
		<logic:notEmpty name="ContactPage" property="tags" >
			<meta http-equiv="keywords"
				content="<bean:write name="ContactPage"
				property="tags" />">
		</logic:notEmpty>
</logic:present>
<title><bean:message key="title.contact" /></title>
<link rel="stylesheet" type="text/css" href="styleSheets/iservices.css" />

</head>

<body onload="javascript:document.RequestForm.senderIname.focus();">
<logic:present name="ContactPage" scope="session">
	<center>
	<table cellspacing=25 border=0 cellpadding=0 width="800">
		<%@ include file="leftMenu.jsp" %>
		<td style="background-image:url(<%=imagePath%>/grey-bg.gif);" width="605" valign="top">
			<html:form	action="/SaveRequest" method="post" >
				<input type="hidden" name="synonym" value='<bean:write	name="synonym" />' />
				<table border="0" cellspacing=0 cellpadding=0 width=100%>
					<tr>
						<td width="20"></td>	
						<td colspan="3" class="bigTitle" height="56">
							<bean:message key="label.contact" />
							<font class="blue-bigtext" >
								&nbsp;<bean:write	name="ContactPage" property="displayName" />
								(<bean:write name="synonym" />) 
							</font>
						</td>
					</tr>
					
					<tr><td colspan="4"></td></tr>
					<tr>
						<td width="20"></td>
						<td colspan="2" class="blue-smalltext"><bean:write
							name="ContactPage" property="displayMsg" /></td>
						<td width="20"></td>
					</tr>
					<tr>
						<td height="10" colspan="4"></td>
					</tr>
					<tr>
						<td width="20"></td>					
						<td class="error-text" colspan="2"><b><html:errors/></b> </td>
						<td width="20"></td>						
					</tr>
					
					<tr>
						<td height="12" colspan="4"></td>
					</tr>
					<tr>
						<td width="20"></td>
						<td height="27" class="blue-smalltext" align="right">
							<b><bean:message key="label.sender.iname" /></b></td>
						<td height="27" class="black-smalltext"><html:text
							maxlength="255" size="28" property="senderIname"
							styleClass="textbox" /></td>
						<td width="20"></td>
					</tr>
	
					<tr>
						<td width="20"></td>					
						<td height="27" class="blue-smalltext" align="right">
							<b><bean:message key="label.sender.email" /></b></td>
						<td height="27" class="black-smalltext"><html:text
							maxlength="255" size="28" property="senderEmail" 
							styleClass="textbox" /></td>
						<td width="20"></td>
					</tr>

					<tr>
						<td width="20"></td>					
						<td height="27" class="blue-smalltext" align="right">
							<b><bean:message key="label.sender.name" /></b></td>
						<td height="27" class="black-smalltext"><html:text
							maxlength="255" size="28" property="senderName"
							styleClass="textbox" /></td>
						<td width="20"></td>							
					</tr>
					<tr>
						<td colspan="4" height="8" ></td>
					</tr>
	
					<tr>
						<td width="20"></td>				
						<td class="blue-smalltext" align="right" valign="top">
							<b><bean:message key="label.msg" /> </b>
						</td>
						<td ><html:textarea property="msg" rows="12" cols="45" styleClass="textarea-smalltext" onkeyup="checkLength('msg',1000);" onmouseout="checkLength('msg',1000);" />
						</td>
					</tr>
					<tr>
						<td colspan="4" height="12" ></td>
					</tr>
					<tr>
						<td colspan="4" height="12" ></td>
					</tr>
					<tr>
						<html:hidden property="step" value="cancel" />
						<td colspan="2" height="12" ></td>						
						<td height="20" class="black-smalltext">
							&nbsp;&nbsp; 
							<a style="cursor:pointer; color:rgb(0,0,255);" accesskey="enter"> 
								<img border="0" src="<%=imagePath%>/button-submit.jpg" alt=""
									onclick="submitForm('<%=IContactConstants.REQ_PTR_STEP_SAVE%>');"  /> 
							</a>
							&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
							<a style="cursor:pointer; color:rgb(0,0,255);" > 
								<img border="0" src="<%=imagePath%>/button-cancel.jpg" alt=""
									onclick="submitForm('<%=IContactConstants.REQ_PTR_STEP_CANCEL%>');" /> 
							</a>
						</td>
						<td height="12" ></td>							
					</tr>
					<tr>
						<td colspan="4" height="8" ></td>
					</tr>
					<tr>
						<td height="12" ></td>							
						<td colspan="2" class="blue-smalltext" >&nbsp;&nbsp;<b><a class="link-nounderline" href='<bean:message key="contact.link" /><bean:write name="synonym" />' >Contact Me</a></b></td>
						<td height="12" ></td>
					</tr>
				</table>
			</html:form>
		</td>
		</tr>
		<tr>
			<td height="10" colspan="2">&nbsp;</td>			
		</tr>
	</table>
	</center>
</logic:present>
<logic:notPresent name="ContactPage" scope="session">
		<logic:redirect forward="CheckLogin"  />
</logic:notPresent>
</body>
</html>
